package com.lyhengtongwl.zqsnews.net;

import com.lyhengtongwl.zqsnews.entity.DepositBo;
import com.lyhengtongwl.zqsnews.entity.NewsBaseEntity;
import com.lyhengtongwl.zqsnews.entity.UserBo;
import com.lyhengtongwl.zqsnews.entity.UserContactsBo;
import com.lyhengtongwl.zqsnews.entity.MobileLoginBo;
import com.lyhengtongwl.zqsnews.entity.UserDeviceBo;
import com.lyhengtongwl.zqsnews.entity.UserLocationBo;
import com.lyhengtongwl.zqsnews.entity.WecLoginBo;

import java.util.List;

import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.Query;
import retrofit2.http.Url;

/**
 * Created by Steven on 2019/1/4.
 */
public interface ApiService {

    //    =====================赚钱树===================

    @POST("/htService/configInfo")
    Call<NewsBaseEntity> getConfig();

    //    ==============登录注册接口============
    //检测手机号是否能用
    @GET
    Call<NewsBaseEntity> checkBind(@Url String url);

    //绑定手机号
    @POST("/htLogin/loginByWeChart")
    Call<NewsBaseEntity> bindPhone(@Body WecLoginBo wecLoginBo);

    //手机号登录
    @POST("/htLogin/loginByMobile")
    Call<NewsBaseEntity> loginByPhone(@Body MobileLoginBo mobileLoginBo);

    //获取文章列表
    @GET("/htArticle/getByType")
    Call<NewsBaseEntity> getArticle(@Query("page") int page, @Query("exCodingId") String typeId, @Query("locationCode") String locationCode);

    //获取本地文章
    @GET("/htArticle/getByType")
    Call<NewsBaseEntity> getLocalArticle(@Query("page") int page, @Query("exCodingId") String typeId, @Query("locationCode") String locationCode);

    //获取文章分类信息
    @GET("/htArticleType/getType")
    Call<NewsBaseEntity> getArticleType();

    //    上传位置信息
    @POST("/htUserLocation/InsertUserLocation")
    Call<NewsBaseEntity> upLoadLocation(@Body UserLocationBo userLocationBo);

    //上传通讯录
    @POST("/htUserContacts/InsertUserContacts")
    Call<NewsBaseEntity> upLoadContacts(@Body List<UserContactsBo> userContactsBos);


    //上传设备信息
    @POST("/htUserDevice/addToData")
    Call<NewsBaseEntity> upLoadDeviceMsg(@Body UserDeviceBo userDeviceBo);

    //获取验证码
    //获取文章列表
    @GET("/htLogin/getCode")
    Call<NewsBaseEntity> getPhoneCode(@Query("mobile") String mobile);

    //获取用户信息(提现里面)
    @GET("/htUserInfo/getByUserIncome")
    Call<NewsBaseEntity> getByUserIncome();


    //插入到数据库
    @PUT("/htUserInfo")
    Call<NewsBaseEntity> insertData(@Body UserBo userBo);

    //收徒赚钱
    @GET("/htUserInfo/getAllIncome")
    Call<NewsBaseEntity> getAllInCome();

    //获取收入明细
    @GET("/htIncome/page")
    Call<NewsBaseEntity> getInComeRecord(@Query("current") int id, @Query("userId") String userId);
    //提现

    //
//    @HTTP(method = "GET", path = "/htDeposit/addDeposit", hasBody = true)
    @POST("/htDeposit/addDeposit")
    Call<NewsBaseEntity> toWithDraw(@Body DepositBo depositBo);

    //校验原来的手机号是否已经绑定
    @GET("/htLogin/validateMobile")
    Call<NewsBaseEntity> checkOldMobile(@Query("userId") int userId, @Query("mobile") String mobile, @Query("code") String code, @Query("codeid") String codeid);

    //插入到数据库
    @PUT("/htLogin/chageMobile")
    Call<NewsBaseEntity> changeMobile(@Query("userId") int userId, @Query("mobile") String mobile, @Query("code") String code, @Query("codeid") String codeid);

    //用户实名认证
    @POST("/htUserAuthinfo/auth")
    Call<NewsBaseEntity> toAuth(@Query("idcard") String idcard, @Query("realname") String realname, @Query("peopleImg") String peopleImg);

    //退出登录
    @GET("/htLogin/logout")
    Call<NewsBaseEntity> loginOut();

    //阅读收益
    @POST("/htArticle/read")
    Call<NewsBaseEntity> getMoney(@Query("idStr") String idStr, @Query("readerIdStr") String readerIdStr);

    //获取客服信息
    @POST("/htService/serviceInfo")
    Call<NewsBaseEntity> getServiceInfo();

    //签到
    @POST("/htArticle/sign")
    Call<NewsBaseEntity> toQD();

    //获取提现记录
    @GET("/htDeposit/page")
    Call<NewsBaseEntity> getWithDrawRecord(@Query("current") int current, @Query("userId") String userId);

    //获取
    @GET("/htUserInfo/getShareQr")
    Call<NewsBaseEntity> getShareOr();

    //获取公告列表
    @POST("/htActivity/search")
    Call<NewsBaseEntity> getGG();

    //获取新手任务
    @GET("/htUserTask/viewTask")
    Call<NewsBaseEntity> getTask(@Query("userId") int userId);

    //领取奖励
    @GET("/htUserTask/getAward")
    Call<NewsBaseEntity> receiveAward(@Query("taskId") int taskId, @Query("userId") int userId);

    //阅读广告上传数量
    @POST("/htArticle/click")
    Call<NewsBaseEntity> articleClick(@Query("id") int id, @Query("typeId") int typeId);

    //获取红包
    @GET("/htLogin/setRedBag")
    Call<NewsBaseEntity> getRedBag(@Query("userId") int userId);

    //获取徒弟详情
    @GET("/htUserInfo/getAllIncomes")
    Call<NewsBaseEntity> getAllIncomes();

    //获取徒弟徒孙全部数据
    @GET("/htUserInfo/getAllPrentice")
    Call<NewsBaseEntity> getAllPrentice();

    //获取有效徒弟徒孙
    @GET("/htUserInfo/getRealPrentice")
    Call<NewsBaseEntity> getRealPrentice();

    //获取无效徒弟徒孙
    @GET("/htUserInfo/getNotPrentice")
    Call<NewsBaseEntity> getNotPrentice();

    //获取提现金额数
    @GET("/htOutmoney/list")
    Call<NewsBaseEntity> getWithDrawMoney(@Query("userId") String userId);

    //修改图像
    @Multipart
    @POST("/htUserInfo/pictures")
    Call<NewsBaseEntity> modifyHead(@Query("userId") String userId, @Part MultipartBody.Part file);

    //实名认证
    @Multipart
    @POST("/htUserAuthinfo/auth")
    Call<NewsBaseEntity> auth(@Query("realname") String realName, @Query("idcard") String idCard, @Part MultipartBody.Part file);

    //人脸比对
    @Multipart
    @POST("/htUserAuthinfo/AuthImg")
    Call<NewsBaseEntity> authImg(@Part MultipartBody.Part file);

    //获取徒弟详情
    @GET("/htUserRecruit/getList")
    Call<NewsBaseEntity> getDiscipleDetails(@Query("userId") String userId, @Query("prenticeId") String prenticeId);

    //获取当前是否有收益
    @GET("/htIncome/look")
    Call<NewsBaseEntity> isHaveEarn(@Query("userId") String userId);

    //检测版本是否需要进行更新
    @GET("htServiceUpdate/select")
    Call<NewsBaseEntity> checkNewsVersion();

    ///htOpenPage/countH5 统计页面点击次数
    @GET("htOpenPage/countH5")
    Call<NewsBaseEntity> upClickCount(@Query("userId") String userId, @Query("title") String title, @Query("chineseTitle") String chineseTitle);

    //查询我的收藏
    @GET("/htCollect/myCollection")
    Call<NewsBaseEntity> getMyCollection(@Query("userId") String userId, @Query("page") int page);

    //查询我的上传
    @GET("/htArticleUpload/getMyUpload")
    Call<NewsBaseEntity> getMyUpload(@Query("userId") String userId, @Query("page") int page);

    //点击收藏取消按钮
    @POST("/htCollect/clickCollecting")
    //flag为0时, 取消收藏, flag为1时,进行收藏
    Call<NewsBaseEntity> collectArticle(@Query("userId") String userId,
                                        @Query("articleId") String articleId,
                                        @Query("flag") String flag);

    //查看是否收藏了该篇文章
    @POST("/htCollect/lookCollecting")
    Call<NewsBaseEntity> checkCollect(@Query("articleId") String articleId,
                                      @Query("userId") String userId);

    //搜索文章
    @GET("/htArticle/search")
    Call<NewsBaseEntity> searchNewsArticle(@Query("search") String typeId, @Query("page") int page);

    //关注公众号
    @POST("/htUserTask/attentionTo")
    Call<NewsBaseEntity> toComplete(@Query("userId") String userID, @Query("taskId") String taskId);

    //查询提现是否被驳回
    @GET("/htDeposit/getIsTell")
    Call<NewsBaseEntity> checkIsTell(@Query("userId") String userId);

    //首页公告列表
    @GET("/htNotice/selectNotice")
    Call<NewsBaseEntity> toastNotice();

    //获取分享 链接
    @POST("/htService/getShortUrl")
    Call<NewsBaseEntity> shortChain(@Query("longUrl") String longUrl);

    //实名认证仅仅是身份证和 姓名
    @POST("/htUserAuthinfo/authNoFace")
    Call<NewsBaseEntity> toAuth(@Query("idcard") String idCard, @Query("realname") String realName);

    //快手上传设备的唯一标识
    @POST("/htFuckKs")
    Call<NewsBaseEntity> upLoadUnique();

}